#include "CustomerManager.h"
#include "Customer.h"
#include <stdlib.h>
#include <pthread.h>
#include <iostream>

using namespace std;

void CustomerManager::empezar()
{
  int randNumber;
  int cont = 0;
 srand(time(NULL)); 
  while( cont++ < 10)
    {	
      randNumber =  1 + (int) (rand()%4);
      
      cout << "Time Sleep: " << randNumber << endl;
      sleep(randNumber);
      current = new Customer(getIdCustomer());

      notifyObs();
    }
}

Customer* CustomerManager::getNewCustomer()
{
  return current;
}

int CustomerManager::getIdCustomer()
{
	idCustomer++;
	return idCustomer;
}
